//
//  SkillCollectionViewCell.m
//  LOL_PalmarHelper
//
//  Created by dlios on 15-6-27.
//  Copyright (c) 2015年 hantao. All rights reserved.
//

#import "SkillCollectionViewCell.h"

@implementation SkillCollectionViewCell
-(void)dealloc
{
    [_str release];
    [_model release];
    [_myImageV release];
    [_label release];
    [super dealloc];
    
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    
    return self;
    
    
}

-(void)createSubviews
{
    
    self.myImageV =[[UIImageView alloc] initWithFrame:self.contentView.bounds];
    self.myImageV.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.myImageV];
    [[self.myImageV layer]setCornerRadius:50.0];
    
    
    
    
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, self.myImageV.frame.size.height+self.myImageV.frame.origin.y, 80, 30)];
    self.label.backgroundColor = [UIColor whiteColor];
    self.label.textAlignment = NSTextAlignmentCenter;
    
    [self.contentView addSubview:self.label];

    
    
    
   
    
    
}

-(void)setModel:(skill *)model
{
    if (_model != model) {
        [_model release];
     _model  =   [model retain];
    }
    

    
    NSURL *url = [NSURL URLWithString:self.model.thumbURL];
    self.label.text = self.model.name;

   [self.myImageV sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"image13.png"]];
    

    
    
}

-(void)setStr:(NSString *)str
{
    if (_str != str) {
        [_str release];
        _str = [str retain];
    }
    self.myImageV.image  = [UIImage imageNamed:self.str];
    
}

















@end
